<!DOCTYPE html>
<#assign dicSelect=JspTaglibs["http://www.casic304.cn/dicSelect"] />
<#assign secSelect=JspTaglibs["http://www.casic304.cn/secSelect"] />
<#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
<html>
<head>
    <meta charset="utf-8">
    <title>失效分析基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <!--<link rel="stylesheet" href="/qbdmsStatic/style/forms/currencyCss.css">-->
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body  class="listBody">
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <form class="formPreview layui-form" requrl="${ctx}/qbdms/wQbdFailureAnalysisInfo/get" lay-filter="wQbdFailureAnalysisInfoDataForm">
            <input type="hidden" name="id" placeholder="请输入" autocomplete="off" class="layui-input "
                   maxlength="50" fieldname="id">
            <div class="qbdms-formTitle">失效分析信息 <i class="qbdms-returnOn closeWindow">返回</i></div>
            <div class="qbdms-formBody" style="margin-bottom: 75px">
                <@fillDept.dept css="dragInfo temSpace" id="tbxx"/>
                <div class="layui-row">

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="元器件名称">元器件名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="componentsName"
                                   lay-reqtext="元器件名称是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="密级">密级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@secSelect.sec_select data_src=1 required=true name="secret"/>
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="分析单位">分析单位<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="unitOfAnalysis"
                                   lay-reqtext="分析单位是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效分析报告编号">失效分析报告编号<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="failAnalysisReportNo"
                                   lay-reqtext="失效分析报告编号是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效时间">失效时间<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="expirationTime" readonly placeholder="请输入" lay-verify="required"
                                   autocomplete="off" class="layui-input dateTimeFiled input-right time-init"
                                   maxlength="50" fieldname="expirationTime" lay-reqtext="请输入失效时间是必填项" >
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="型号规格">型号规格<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="modelSpec"
                                   lay-reqtext="型号规格是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="批次">批次<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="batch"
                                   lay-reqtext="批次是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="生产单位">生产单位<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="productionUnit"
                                   lay-reqtext="生产单位是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="质量等级">质量等级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="qualityLevel" verify="required" reqtext="质量等级是必填项"  nodeKey="dpazldj"  />
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效数量">失效数量<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required|number" name="failNums"
                                   lay-reqtext="失效数量是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="所属型号代号">所属型号代号<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <select name="modelCode" class="xhdh" lay-filter="xh" lay-verify="required" lay-reqtext="所属型号代号是必填项" lay-search=""></select>
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="所属整机代号">所属整机代号<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="machineCode"
                                   lay-reqtext="所属整机代号是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效发生阶段">失效发生阶段<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="failStage" verify="required" reqtext="失效发生阶段是必填项"  nodeKey="sxfsjd" />
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效模式">失效模式<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="failMode" verify="required" reqtext="失效模式是必填项" nodeKey="sxms" />
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="委托单位">委托单位<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="requester"
                                   lay-reqtext="委托单位是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效地点">失效地点<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input " lay-verify="required" name="failPlace"
                                   lay-reqtext="失效地点是必填项" maxlength="50">
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="分析结论">分析结论<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="analysisConclusion" verify="required" reqtext="分析结论是必填项" nodeKey="fxjl" />
                        </div>
                    </div>

                    <div class="qbdms-oneForm  ">
                        <label class="layui-form-label qbdms-label" title="失效原因">失效原因<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="reasonForFail" verify="required" reqtext="失效原因是必填项" nodeKey="sxyy" />
                        </div>
                    </div>

                    <div class="qbdms-textarea ">
                        <label class="layui-form-label qbdms-label" title="故障现象">故障现象<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <textarea name="failPhenomenon"  placeholder="请输入"  lay-reqtext="故障现象是必填项"
                                      autocomplete="off" class="layui-textarea  textInput"  lay-verify="required"
                                      maxlength="500" fieldname="failPhenomenon"></textarea>
                        </div>
                    </div>

                </div>
            </div>

            <div class="layui-form-item btnformItem">
                <p>
                    <span id="hideAndShow" >
                        <a lay-submit lay-filter="wQbdTecBasicmanage" class="layui-btn btn-n privateSubmit qbdms-oneBtn "
                           requrl="${ctx}/qbdms/wQbdFailureAnalysisInfo/save">提交</a>
                    </span>
                    <button type="reset" id="closeWindow" style="margin-left: 10px;"
                            class="layui-btn layui-btn-sm btn-save closeWindow qbdms-oneBtnLine">取消
                    </button>
                </p>
            </div>
        </form>
    </div>
</div>

<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base:  serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'common', 'laydate', 'jquery','propsHandle','publicMethods'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var common = layui.common;
        var propsHandle = layui.propsHandle;
        var dateTimeFiledLen = $(".dateTimeFiled");
        var publicMethods = layui.publicMethods;
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
                ,max:new Date().valueOf()
            });
        }
        var  defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                formAreaInfo: '.formPreview',
                formAreaInfo: 'html',
                temDate: '.temDate',
                uploadFileBtn: '.uploadFileBtn',
                uploadImgBtn: '.uploadImgBtn',
                richTextArea: '.richTextArea',
                selectInput: '.selectInput',
                radioOptionCont: '.radioOptionCont',
                dataLexiTree: '.dataLexiTree',
                selectorBtn: '.selectorBtn'
            },
            temQuery = new propsHandle();  // 实例化模板功能部分

        // 初始化模板功能
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });
        //关闭当前页面
        $(".closeWindow").click(function () {
            window.location.href = '${ctx}/qbdms/wQbdFailureAnalysisInfo/view/list';
        });


        var xhdh = eval('${wQbdXhdhs}'); //型号代号
        var initXHDH = function(optionObj, item){
            optionObj.text = item.fModelcode;
            optionObj.value = item.fModelcode;
            optionObj.setAttribute("xhdh", item.fModelname);
        };
        common.initDicData("modelCode", xhdh, "", initXHDH);

        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name: 'wQbdFailureAnalysisInfoDataForm',
            idValue: "${id}",
            primary: "id",
            updateCallback: function (data) {
                if (common.filterRecord(data)) {
                    if ($(".privateSubmit")) {
                        $(".privateSubmit").attr("disabled", false).css("pointer-events", "auto");
                    }
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        layer.close(index);
                        window.location.href = '${ctx}/qbdms/wQbdFailureAnalysisInfo/view/list';
                    });
                } else {
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                }
                return false;
            }
            ,getCallback:function(data){
                $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span>" +
                    "<span class='qbdms-TBinformationText'>【"+data.data.filldept+"   | "+data.data.fillman+"  | "+data.data.filldate+"】</span>");

            }
        });
    });
</script>
</body>
</html>